<script type="text/javascript">{$javaScript}</script>
<!-- style sheet -->
<style type="text/css">{$styleSheet}</style>

<!-- menu include -->
{include file="menu.tpl"}
{if $errors}<br/><div id="error">{$message}</div>{/if}
<br/>

{if $renderInfo}
<div id="info">
<p><image src="http://wii-social.com/html/images/information.png" />&nbsp;&nbsp;Please update your <a href="{$HOST}/user-profile.php?do=edit">profile</a> to improve your WiiSocial experience.</p>
</div>
<br/>
{/if}

<div class="name">{$userName} 
<img src="http://wii-social.com/media.php?type=image&name=flag&id={$userLocation}" /> 
<span class="small-text">welcome to WiiSocial. 
(<a href="{$HOST}/user-profile.php?do=edit">Edit Profile</a>)
</div>

<div id="container">

<div id="left" style="float: left; width: 200px;">
<img src="{$user->getProfilePicBigURL()}" />
</div>

<div id="right" style="float: right; width: 520px;">

<div id="wiicode">
<b>Your Wii code: </b><span class="large-text">{$wiiCode}</span>
</div>

<div class="header">
Your Games <span style="font-size: 12px;"><a href="{$HOST}/games.php?do=alphabetical&index=A">Add Games</a></span>
</div>
<span style="font-family: sans-serif; color: #333333; font-size: 14px;">You have <span style="color: #2c8bf9;"><b>{$numberOfGames}</b></span> games.</span>
<ul style="padding: 0px; margin: 0px;">
{foreach from=$collection item=game}
<li style="list-style-type: none; border-bottom: 2px solid white; padding-top: 5px; padding-bottom: 5px; background-color: #eeeeee;">
<table>
  <tr>
    <td><img width="54px" height="75px" src="{$game->getImageURL()}" /></td>
    <td style="width: 325px;"><a href="{$HOST}/game.php?game-id={$game->getID()}">{$game->getTitle()}</a><br/>
           <span style="padding-left: 10px; padding-top: 10px; font-family: verdana; color: #b7b7b7; font-size: 12px">Friend Code:</span>
     {if !$game->getFriendCode()}
     	<span class="add-friend-code" id="add-friend-code-{$game->getID()}" onclick=addFriendCode('{$game->getID()}')>Add</span>
     	<form action="{$HOST}/CodeHandler.php" method="get">
     	<input type="hidden" name="do" value="add-friend-code"/>
     	<input type="hidden" name="game-id" value="{$game->getID()}"/>
     	<input type="text" name="friend-code-value" class="friend-code-input" id="friend-code-input-{$game->getID()}"/>
     	<input type="image" src="{$HOST}/html/images/add.png" class="friend-code-submit" id="friend-code-submit-{$game->getID()}"/>
     	</form>
	{else}
		<span style="color: #3b5998;">{$game->getFriendCode()}</span>
	{/if}
      </td>
      <td>
        <ul id="options">
         <li><img src="http://wii-social.com/html/images/cross.png"/>&nbsp;<a href="{$HOST}/GameHandler.php?do=collection-delete&id={$game->getID()}">Delete</a></li>
         <li><img src="http://wii-social.com/html/images/group.png"/>&nbsp;<a href="{$HOST}/game.php?game-id={$game->getID()}&amp;view=friends">Find Online Players</a></li>
         <li><a href="{$HOST}/game.php?game-id={$game->getID()}">Rate</a></li>
	    </ul>
      </td>
  </tr>
</table>
</li>
{/foreach}
</ul>
<br/>
<div class="header">
Your Wishlist <span style="font-size: 12px;"><a href="{$HOST}/games.php?do=alphabetical&index=A">Add Games</a></span>
</div>
<span style="font-family: sans-serif; color: #333333; font-size: 14px;">You have <span style="color: #2c8bf9;"><b>{$numberOfGamesInWishList}</b></span> games in your wishlist.</span>


</div>

</div>
<div style="clear: both"></div>



<!-- div>
<input type="hidden" value="{$IP}" />
<div id="upcoming-games">
<h1>Games Coming Soon</h1>
  <div id="this-months-games">
  <h1><img src="http://wii-social.com/html/images/calendar.png"/>&nbsp;{$thisMonth}</h1>
  <ul>
  {foreach from=$thisMonthsReleases item=game}
    <li><img src="{$HOST}/html/images/bullet.png" style="padding: 0px;"/><a href="http://wii-social.com/external.php?url={$game->getAmazonAssociateURL()}&game-id={$game->getID()}" target="_blank">
    	{$game->getTitle()}</a> <span style="font-size: 10px; color: grey; font-family: 
    	sans-serif">{$game->getReleaseDate()}</span>
    	<a href="{$HOST}/GameHandler.php?do=wishlist-add&id={$game->getID()}">
    	<img title="Add {$game->getTitle()} to your wish list" src="http://wii-social.com/html/images/add.png"/></a>, </li>
  {/foreach}
  </ul>
  </div>
  <div id="next-months-games">
  <h1>{$nextMonth}</h1>
  <ul>
  {foreach from=$nextMonthsReleases item=game}
    <li><a href="http://wii-social.com/external.php?url={$game->getAmazonAssociateURL()}&game-id={$game->getID()}" target="_blank">
    	{$game->getTitle()}</a> <span style="font-size: 10px; color: grey; font-family: 
    	sans-serif">{$game->getReleaseDate()}</span>
    	<a href="{$HOST}/GameHandler.php?do=wishlist-add&id={$game->getID()}">
    	<img title="Add {$game->getTitle()} to your wish list" src="http://wii-social.com/html/images/add.png"/></a>, </li>
  {/foreach}
  </ul>
  </div>
  <div id="footer-menu"><span style="font-size: 10px;">switch month: </span><span id="this-month" onclick=thisMonthsReleases()>{$thisMonth}</span> | <span id="next-month" onclick=nextMonthsReleases()>{$nextMonth}</span></div
</div-->

<!-- div id="sub-menu">
<div style="float: left;"><img src="http://wii-social.com/media.php?type=image&name=flag&id={$userLocation}" />
<b>{$userName}</b>, welcome to WiiSocial.</div><div style="float: right; margin-right: 7px;"><a href="{$HOST}/user-profile.php?do=edit">Edit Profile</a></div>
</div-->

<!-- left panel 

<div id="left-panel">
 <div id="your-games">
 <br/>
 <div id="your-games-header">
 <div style="float:left">
 <span style="font-family: sans-serif; color: #333333; font-size: 12px; margin-left: 10px">You have <span style="color: #2c8bf9;"><b>{$numberOfGames}</b></span> games</span>
 </div>
 <div style="float:right">
<span onclick="showMyGames()" id="games-menu">My Games</span> | <span onclick="showWishList()" id="games-menu">My Wish List<span> 
 </div>
 </div>
 
 <ul id="game-list">
 {foreach from=$collection item=game}
 <li>
 <table>
   <tr>
     <td width="20"><a href="http://wii-social.com/external.php?url={$game->getAmazonAssociateURL()}&game-id={$game->getID()}" target="_blank"><img style="border:none;" src="{if $game->getImageURL()}{$game->getImageURL()}{else}http://wiisocial.mattmakins.co.uk/html/images/no-image.png{/if}" width="50" height="75"/></a></td>
     <td width="330" style="font-size: 14px;"><a href="http://wii-social.com/external.php?url={$game->getAmazonAssociateURL()}&game-id={$game->getID()}" target="_blank">{$game->getTitle()}</a><br/>
     <span style="padding-left: 10px; padding-top: 10px; font-family: verdana; color: #b7b7b7; font-size: 12px">Friend Code:</span>
     {if !$game->getFriendCode()}
     	<span class="add-friend-code" id="add-friend-code-{$game->getID()}" onclick=addFriendCode('{$game->getID()}')>Add</span>
     	<form action="{$HOST}/CodeHandler.php" method="get">
     	<input type="hidden" name="do" value="add-friend-code"/>
     	<input type="hidden" name="game-id" value="{$game->getID()}"/>
     	<input type="text" name="friend-code-value" class="friend-code-input" id="friend-code-input-{$game->getID()}"/>
     	<input type="image" src="{$HOST}/html/images/add.png" class="friend-code-submit" id="friend-code-submit-{$game->getID()}"/>
     	</form>
	{else}
		<span style="color: #3b5998;">{$game->getFriendCode()}</span>
	{/if}
     </td>
     <td width="100px" style="padding-left: 10px; font-family: verdana; color: #b7b7b7; font-size: 12px">
      <ul id="options">
        <li><img src="http://wii-social.com/html/images/cross.png"/>&nbsp;<a href="{$HOST}/GameHandler.php?do=collection-delete&id={$game->getID()}">Delete</a></li>
        <li><img src="http://wii-social.com/html/images/group.png"/>&nbsp;<a href="{$HOST}/friends.php?do=find-friends&game-id={$game->getId()}">Find Online Players</a></li>
	  </ul>
     </td>
   </tr>
 </table>
 </li>
 {/foreach}
 </ul>
 <span class="add-games"><a href="{$HOST}/games.php?do=alphabetical&index=A">Add Games</a></span>
 </div>
<!-- wish list section 
 <div id="wish-list">
 <br/>
 <span style="font-family: sans-serif; color: #333333; font-size: 12px; margin-left: 10px">You have <span style="color: #3b5998;">{$numberOfGamesInWishList}</span> games on your wish list.</span>
 <p id="wishlist-list">
 {foreach from=$wishlist item=game}
	&nbsp;-&nbsp; <span><a href="http://wii-social.com/external.php?url={$game->getAmazonAssociateURL()}&game-id={$game->getID()}" target="_blank">{$game->getTitle()}</a></span> &nbsp; <span style="color: #b7b7b7;">({$game->getReleaseDate()})</span>
 	&nbsp;&nbsp;<a href="{$HOST}/GameHandler.php?do=wishlist-delete&id={$game->getID()}"><img src="http://wii-social.com/html/images/cross.png"/></a>
	<a href="{$HOST}/GameHandler.php?do=collection-add&id={$game->getID()}"><img src="{$HOST}/html/images/add.png" alt="Add '{$game->getTitle()}' to collection" title="Add '{$game->getTitle()}' to collection" /></a>
	<br/>	
 {/foreach}
 </p>
 <span class="add-games"><a href="{$HOST}/games.php?do=alphabetical&index=A">Add Games</a></span>
 </div>
</div>-->
 <fb:google-analytics uacct="UA-1595732-3" />